Skip to content

ref(tsc): projectTeams endpoint to apiOptions#113063

Merged
TkDodo merged 3 commits intomasterfrom
tkdodo/ref/projectTeams-to-apiOptions
Apr 16, 2026
Merged

ref(tsc): projectTeams endpoint to apiOptions#113063
TkDodo merged 3 commits intomasterfrom
tkdodo/ref/projectTeams-to-apiOptions

Conversation

@TkDodo
Copy link
Copy Markdown
Collaborator

@TkDodo TkDodo commented Apr 15, 2026

No description provided.

@TkDodo TkDodo marked this pull request as ready for review April 15, 2026 16:28
@TkDodo TkDodo requested a review from a team as a code owner April 15, 2026 16:28
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 15, 2026
@sentry
Copy link
Copy Markdown
Contributor

sentry bot commented Apr 15, 2026

Sentry Snapshot Testing

Name Added Removed Modified Renamed Unchanged Status
sentry-frontend
sentry-frontend
0 0 0 0 204 ✅ Unchanged

⚙️ sentry-frontend Snapshot Settings

Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 579fdef. Configure here.

Comment thread static/app/actionCreators/projects.tsx Outdated
);
},
[api, orgSlug, projectSlug, cursor, queryClient]
[api, orgSlug, projectSlug, queryKey, queryClient]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useCallback memoization broken by unstable queryKey reference

Low Severity

projectTeamsApiOptions() is called at render time, producing a new queryKey array reference on every render. Since React's useCallback uses Object.is for dependency comparison, the queryKey dependency always differs, causing the callback to be recreated every render. The old code used primitive cursor as a dependency, which compared stably. The callbacks are passed directly as onRemoveTeam and onCreateTeam props, so this causes unnecessary child re-renders on every parent render.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 579fdef. Configure here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well then let’s just remove it: 0f6b667

@TkDodo TkDodo merged commit 4244ff0 into master Apr 16, 2026
65 checks passed
@TkDodo TkDodo deleted the tkdodo/ref/projectTeams-to-apiOptions branch April 16, 2026 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants